package com.ebook.server.service;

import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;

import javax.annotation.Resource;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.jdbc.core.JdbcTemplate;

public class PartnerService {
	@Resource
	private JdbcTemplate jdbcTemplate;
	  String sqlCode = "select * from partenInfo where id=?" ;
	  private static Log logger = LogFactory.getLog(PartnerService.class); 
	public  String  Pattern(String ran)
	{   
		         if (ran!=null) {
		             Pattern p = Pattern.compile("[a-zA-Z]");;
		            ran.replaceAll("[a-zA-Z]", "");
		        }
	
		  return ran ;
		    
	}
	public   Map<String, Object>  getCode(int partnid)
	{         Map<String, Object> code ;
	 String sqlCode = "select * from partenInfo where id=?" ;
		        if(  partnid >0)
		        {
		    //  jdbcTemplate.queryForMap(sqlCode)；
		        code =	jdbcTemplate.queryForMap(sqlCode,partnid);	
		        	
		        }
		        else 
		              return  null; 
	
		  return code ;
		    
	}
	
	
    
}
